﻿<Window x:Class="DynaCAD.NewPartCreator"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DynaCAD" Opacity="1" WindowStyle="SingleBorderWindow" BorderBrush="#00000000" WindowStartupLocation="CenterScreen" WindowState="Maximized" Height="1024" Width="1280"  KeyDown="MainWindowKeyDown" Closing="DynaCAD_Editor_Closing">
    <Window.Resources>
        <VisualBrush x:Key="MirrorBrush" 
         Visual="{Binding ElementName=ParcaStackPanel}" TileMode="None" 
         Stretch="Uniform" AutoLayoutContent="False"/>
    </Window.Resources>
    <Grid Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="93" />
            <RowDefinition Height="170" />
            <RowDefinition Height="239*" />
        </Grid.RowDefinitions>
        <DockPanel Name="MainPanel" Background="#FFF0F0F0" Grid.RowSpan="3">
            <DockPanel Name="Title_Panel" VerticalAlignment="Top" DockPanel.Dock="Top" Height="50" Background="#FF11BA60">
                <TextBlock Name="Title" FontFamily="Buxton Sketch" Text="DynaCAD" VerticalAlignment="Center" FontSize="30" ></TextBlock>
            </DockPanel>
            <DockPanel Name="FileOperations" DockPanel.Dock="Top" Height="25" Background="Gray">
                <Border BorderThickness="2" BorderBrush="LightGray" CornerRadius="3">
                    <Menu IsMainMenu="True" Height="23">
                        <MenuItem Name="File" Header="File">
                            <MenuItem Name="New_File" Header="New File" Click="New_File_Click" />
                            <MenuItem Name="File_Open" Header="Open File" Click="Open_File_Click" />
                            <MenuItem Name="File_Save" Header="Save" Click="File_Save_Click" />
                            <MenuItem Name="File_SaveAs" Header="SaveAs  " Click="File_SaveAs_Click" />
                        </MenuItem>
                        <MenuItem Name="Edit" Header="Edit"/>
                    </Menu>
                </Border>
            </DockPanel >
            <DockPanel Name="Tools"  Width="1280" DockPanel.Dock="Top" Margin="0,0,0,0" Background="LightGray" VerticalAlignment="Top" HorizontalAlignment="Left" >
                <RadioButton DockPanel.Dock="Left" Name="LineSwitch" Content="Line" Height="18" Width="100" Checked="LineChecked" />
                <RadioButton DockPanel.Dock="Left" Name="PolyLineSwitch" Content="PolyLine" Height="18" Width="100" Checked="PolyLineSwitch_Checked" />
                <RadioButton DockPanel.Dock="Left" Name="RectangleSwitch" Content="Rectangle" Height="18" Width="100" Checked="RectangleSwitch_Checked" />
                <RadioButton DockPanel.Dock="Left" Name="ElipseSwitch" Content="Ellipse" Height="18" Width="100" Checked="EllipseSwitch_Checked" />
                <RadioButton DockPanel.Dock="Left" Name="ArcSwitch" Content="Arc" Height="18" Width="100" Checked="ArcChecked" />
                <RadioButton DockPanel.Dock="Left" Name="BezierSwitch" Content="Bezier" Height="18" Width="100" Checked="BezierChecked" />
                <RadioButton DockPanel.Dock="Left" Name="QuadraticBezierSwitch" Content="QuadraticBezier" Height="18" Width="100" Checked="QuadraticBezierChecked" />
                <RadioButton DockPanel.Dock="Left" Name="SplineSwitch" Content="Spline" Height="18" Width="100" Checked="SplineChecked" />
                <!--RadioButton DockPanel.Dock="Left" Name="SelectSwitch" HorizontalAlignment="Left" Content="Select" Height="18" Width="100" Checked="SelectChecked" /-->
                <RadioButton DockPanel.Dock="Left" Name="UniteSwitch" HorizontalAlignment="Left" Content="Unite" Height="18" Width="100" Checked="UniteChecked" />
                <RadioButton DockPanel.Dock="Left" Name="SubstractSwitch" HorizontalAlignment="Left" Content="Substract" Height="18" Width="100" Checked="SubstractChecked" />

            </DockPanel>
            <StackPanel Name="CurrentView" DockPanel.Dock="Top" Background="LightGray"  VerticalAlignment="Top" HorizontalAlignment="Left" Height="200" Width="200">
                <Rectangle Height="200" Width="200" Fill="{StaticResource MirrorBrush}"/>
                <Rectangle Name="ViewRect" Margin="0,-200,0,0" Stroke="Black"/>
            </StackPanel>
            <TreeView Name="FileTree" Margin="0,0" DockPanel.Dock="Left" VerticalAlignment="Top" HorizontalAlignment="Left" Height="500"  Width="200" SelectedItemChanged="Selected_ItemIndex" />
        </DockPanel>
        <Border Name="AktiveColorBorder" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="2" Grid.RowSpan="2">
            <Grid Height="170" Name="AktiveColorGrid" Width="250" Background="White" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="20" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                <TextBlock Text="Aktive Color" FontFamily="Buxton Sketch" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" Margin="0,3"></TextBlock>
                <Button Content="Pick Color" Grid.Column="3" Width="70" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="0" Click="Aktive_Pick_Color_Click" />
                <TextBlock Text="Red" Grid.Row="1" FontSize="14" Margin="0,0,0,0" Grid.RowSpan="2" />
                <TextBlock Text="Green" Grid.Row="2" FontSize="14" Margin="0,0,0,0" Grid.RowSpan="2" />
                <TextBlock Text="Blue" Grid.Row="3" FontSize="14" Grid.RowSpan="2" Margin="0,0,0,0" />
                <TextBlock Text="Opacity" Grid.Row="4" FontSize="14" Margin="0,0,0,0" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="AktiveColorR" Width="180" Height="24" Background="Red" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1" ValueChanged="AktiveColorRChanged" Grid.Row="1" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="AktiveColorG" Width="180" Height="24" Background="Green" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1" ValueChanged="AktiveColorGChanged" Grid.Row="2" Grid.RowSpan="2" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="AktiveColorB" Width="180" Height="24" Background="Blue" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1" ValueChanged="AktiveColorBChanged" Grid.Row="3" />
                <Slider Value="255" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="AktiveColorA" Width="180" Height="24" Background="White" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1" ValueChanged="AktiveColorAChanged" Grid.Row="4" />
            </Grid>
        </Border>
        <Border Name="PathPropertyBorder" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="2" Margin="0,3,0,0">
            <Grid Height="500" Name="PathPropertyGrid" Width="250" Background="White">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="85" />
                    <ColumnDefinition Width="60" />
                    <ColumnDefinition Width="105*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="20" />
                    <RowDefinition Height="20" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="353*" />
                </Grid.RowDefinitions>
                <TextBlock Text="Path Properties" TextAlignment="Center" FontFamily="Buxton Sketch" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="15" Width="250" Grid.ColumnSpan="3" />
                <TextBlock Text="Stroke Color" Grid.Row="1" TextAlignment="Left" FontFamily="Buxton Sketch" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="15"  Width="250" Grid.ColumnSpan="3" />
                <Button Content="Pick Color" Grid.Column="3" Width="70" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="1" Click="Stroke_Pick_Color_Click" />
                <TextBlock Text="Red" Grid.Row="2" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Green" Grid.Row="3" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Blue" Grid.Row="4" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Opacity" Grid.Row="5" FontSize="14" Grid.ColumnSpan="3" />
                <TextBlock Text="Fill Color" Grid.Row="6" TextAlignment="Left" FontFamily="Buxton Sketch" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="15"  Width="250" Grid.ColumnSpan="3" />
                <Button Content="Pick Color" Grid.Column="3" VerticalAlignment="Bottom" Height="20" Width="70" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="6" Click="Fill_Pick_Color_Click" />
                <TextBlock Text="Red" Grid.Row="7" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Green" Grid.Row="8" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Blue" Grid.Row="9" FontSize="14" Grid.RowSpan="2" Grid.ColumnSpan="3" />
                <TextBlock Text="Opacity" Grid.Row="10" FontSize="14" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="StrokeColorR" Width="180" Height="24" Background="Red" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="2" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="StrokeColorG" Width="180" Height="24" Background="Green" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="3" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="StrokeColorB" Width="180" Height="24" Background="Blue" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="4" Grid.ColumnSpan="3" />
                <Slider Value="255" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="StrokeColorA" Width="180" Height="24" Background="White" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="5" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="FillColorR" Width="180" Height="24" Background="Red" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="7" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="FillColorG" Width="180" Height="24" Background="Green" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="8" Grid.ColumnSpan="3" />
                <Slider Value="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="FillColorB" Width="180" Height="24" Background="Blue" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="9" Grid.ColumnSpan="3" />
                <Slider Value="255" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,20,0" Name="FillColorA" Width="180" Height="24" Background="White" AutoToolTipPrecision="0" AutoToolTipPlacement="None" BorderBrush="Black" BorderThickness="1" Maximum="255" SmallChange="1"  Grid.Row="10" Grid.ColumnSpan="3" />
                <TextBlock Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" Margin="0,0,30,-2" VerticalAlignment="Bottom" FontSize="14" Text="Stroke"  />
                <CheckBox Grid.Row="11" Grid.Column="0"  Name="Stroke" Margin="0,0,25,0" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="True" />
                <TextBlock Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,40,-2" VerticalAlignment="Bottom" FontSize="14" Text="Fill"  />
                <CheckBox Grid.Row="11" Grid.Column="1"  Name="Fill" Margin="0,0,20,0" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="True" />
                <TextBlock Grid.Row="11" Grid.Column="2" HorizontalAlignment="Right" Margin="0,0,40,-2" VerticalAlignment="Bottom" FontSize="14" Text="Close Path" />
                <CheckBox Grid.Row="11" Grid.Column="2"  Name="Close_Path" Margin="0,0,20,0" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="True" />
                <TextBlock Grid.Row="12" HorizontalAlignment="Left" Margin="0,0,0,-2" VerticalAlignment="Bottom" FontSize="14" Text="Stroke Thickness" Grid.ColumnSpan="3" />
                <TextBox Name="StrokeThickness" Width="100" Grid.Row="12" HorizontalAlignment="Right" Margin="0,0,20,-5" VerticalAlignment="Bottom" FontSize="14" Text="1" Grid.ColumnSpan="3"/>
                <TextBlock Grid.Row="13" HorizontalAlignment="Left" Margin="0,0,0,-2" VerticalAlignment="Bottom" FontSize="14" Text="Stroke Dash Array" Grid.ColumnSpan="3" />
                <TextBox Name="StrokeDashArray" Width="100" Grid.Row="13" HorizontalAlignment="Right" Margin="0,0,20,-5" VerticalAlignment="Bottom" FontSize="14" Text="0" Grid.ColumnSpan="3"/>
                <Button Content="Apply" Width="50" Height="25" Grid.Row="14" VerticalAlignment="Center" HorizontalAlignment="Center" Click="ChangePathPropertyClick" Margin="0,0,0,0" Grid.ColumnSpan="3" />
            </Grid>
        </Border>
        <Grid Name="ParcaGrid" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True" Margin="0,0,0,0" Grid.RowSpan="3">
            <StackPanel   Background="LightGray" VerticalAlignment="Center" HorizontalAlignment="Center" Name="ParcaStackPanel" MouseLeave="ParcaStackPanel_Mouse_Leave" MouseMove="ParcaStackPanel_Mouse_Move" MouseWheel="ParcaStackPanel_Mouse_Wheel" MouseLeftButtonDown="ParsaStackPanel_Mouse_Left_Button_Down" MouseLeftButtonUp="ParcaStackPanel_MouseLeftButtonUp">
                <Viewbox  Name="ParcaViewBox" VerticalAlignment="Center" HorizontalAlignment="Center">

                </Viewbox>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
